namespace WebSiteFool.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class UpdateTableNames : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.Comments", "Article_Id", "dbo.Article");
            DropIndex("dbo.Comments", new[] { "Article_Id" });
            DropTable("dbo.Comments");
            CreateTable(
                "dbo.Comments",
                c => new
                    {
                        Id = c.Guid(nullable: false, identity: true),
                        UserId = c.Int(nullable: false),
                        Content = c.Guid(nullable: false),
                        CreateDate = c.DateTime(nullable: false),
                        Article_Id = c.Guid(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Article", t => t.Article_Id)
                .Index(t => t.Article_Id);
        }
        
        public override void Down()
        {
            CreateTable(
                "dbo.Comments",
                c => new
                    {
                        Id = c.Guid(nullable: false, identity: true),
                        UserId = c.Int(nullable: false),
                        Content = c.Guid(nullable: false),
                        CreateDate = c.DateTime(nullable: false),
                        Article_Id = c.Guid(),
                    })
                .PrimaryKey(t => t.Id);
            
            DropIndex("dbo.Comments", new[] { "Article_Id" });
            DropForeignKey("dbo.Comments", "Article_Id", "dbo.Article");
            DropTable("dbo.Comments");
            CreateIndex("dbo.Comments", "Article_Id");
            AddForeignKey("dbo.Comments", "Article_Id", "dbo.Article", "Id");
        }
    }
}
